package com.design.graduation.asdemo.manager;

import com.design.graduation.asdemo.network.HttpServiceFactory;
import com.design.graduation.asdemo.network.model.LoginResult;
import com.design.graduation.asdemo.network.model.RoomListResult;
import com.design.graduation.asdemo.network.model.StringResult;
import com.design.graduation.asdemo.network.model.TokenResult;
import com.design.graduation.asdemo.network.service.HttpObserver;
import com.design.graduation.asdemo.network.service.LoginService;

import rx.Observer;

/**
 * Created by locfai on 2016/3/1.
 */
public class UserManager extends BaseManager {
    private static LoginService getLoginService() {
        return HttpServiceFactory.getService(LoginService.class);
    }

    public static void RxLogin(String mobile, String securityCode, Observer<LoginResult> observer) {
        startRequest(getLoginService().RxLogin(mobile, securityCode), observer);
    }

    public static void RxRegister(String mobile, String securityCode, String uid,Observer<LoginResult> observer) {
        startRequest(getLoginService().RxRegister(mobile, securityCode,uid), observer);
    }

    public static void setRoomMessage(String position, String lon, String lat, String price, String content, String phone, String imgurl, String hash, Observer<LoginResult> observer) {
        startRequest(getLoginService().setRoomMessage(position, lon, lat, price, content, phone, imgurl, hash), observer);
    }

    public static void getRoomList(String hash, Observer<RoomListResult> observer) {
        startRequest(getLoginService().getRoomList(hash), observer);
    }

    public static void getToken(String id,Observer<TokenResult> observer) {
        startRequest(getLoginService().getToken(id), observer);
    }


}
